package com.yanwu.www.config.version;

import com.yanwu.www.config.version.CustomRequestMappingHandlerMapping;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
 
/**
 * @ClassName:  WebConfig
 * @Description: 增加api version的处理
 * @author: harvey
 * @date:   2019/2/26 10:56
 */
@SpringBootConfiguration
public class WebConfig extends WebMvcConfigurationSupport {
 
    /**
     * 重写请求过处理的方法
     * @return
     */
    @Override
    public RequestMappingHandlerMapping requestMappingHandlerMapping() {
        //return super.requestMappingHandlerMapping();
        RequestMappingHandlerMapping handlerMapping = new CustomRequestMappingHandlerMapping();
        handlerMapping.setOrder(0);
        return handlerMapping;
    }
}
